<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.dinner.model.Seller"%>
<%@page import="com.dinner.model.Consumer"%>
<%@page import="com.dinner.model.MenuType"%>
<%@page import="com.dinner.model.MenuItem"%>
<%@page import="java.util.List"%>
<%@page import="com.dinner.util.PageHelper" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
	List<MenuType> l = (List<MenuType>) request.getSession()
			.getAttribute("MenuTypeList");
	MenuType mt = (MenuType) request.getAttribute("type");
	request.getSession().setAttribute("url", "?typeID="+mt.getMenuType()+"&sellerID="+mt.getSellerID());
	String todo1 = "menuItemPage.do?typeID=";
	String todo2 = "orderSubmission.do?menuID=";
	String message1 = "";
	String message2 = "";
	if (l != null) {
		for (MenuType m : l) {
			message1 += "<tr><td height=\"25\" background=\"../images/left_tb_bg.jpg\" width=\"25\"></td>"
					+ "<td background=\"../images/left_tb_bg.jpg\" align=\"left\" width=\"160\">"
					+ "<a href=\""
					+ todo1
					+ m.getMenuType()
					+ "&sellerID="
					+ m.getSellerID()
					+ "\">"
					+ m.getDescription() + "</a>" + "</td></tr>";
		}
	}
	String loginMessage = "";
	Object c = request.getSession().getAttribute("user");
	if (c != null && c instanceof Consumer) {
		loginMessage = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"189\">"
				+ "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"189\">"
				+ "<tbody><tr><td height=\"13\"><img height=\"25\" width=\"189\" alt=\"用户帐户\"src=\"../images/left_myaccount.jpg\" />"
				+ "</td></tr><tr><td background=\"../images/left_bg01.jpg\" align=\"center\" valign=\"top\">"
				+ "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\"><tbody><tr>"
				+ "<td width=\"40%\"><div align=\"right\"><img height=\"10\" width=\"1\" src=\"../images/kongxi_h16px.gif\" />"
				+ "</div></td><td width=\"60%\" colspan=\"2\"></td></tr><tr><td height=\"25\" align=\"right\">"
				+ " 欢 迎：</td><td align=\"center\" colspan=\"2\">"
				+ ((Consumer) c).getConsumerID()
				+ "</td>"
				+ "</tr><tr><td height=\"25\" align=\"center\" colspan=\"3\"><a class=\"TiShi\" href=\"/51Dinner/userpage/activeOrderQuery.do\">查 看 新 订 单</a></td></tr>"
		+ "</tr><tr><td height=\"25\" align=\"center\" colspan=\"3\"><a class=\"TiShi\" href=\"/51Dinner/userpage/completedOrderQuery.do\">查 看 旧 订 单</a></td></tr></tbody></table>"
				+ "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\"><tbody><tr>"
				+ "<td align=\"center\" valign=\"middle\" colspan=\"2\">"
				+ "<a class=\"TiShi\" href=\"/account/GetPwd.jsp\">修改资料</a></td><td align=\"center\" valign=\"top\">"
				+ "<form action=\"/51Dinner/logout.do\" method=\"post\"><input type=\"image\" name=\"Submit\" src=\"../images/logout.jpg\"/></form></td></tr><tr><td height=\"15\" align=\"right\" width=\"20%\" valign=\"middle\"></td>"
				+ "<td align=\"center\" width=\"40%\" valign=\"middle\"><img height=\"10\" width=\"1\" src=\"../images/kongxi_h16px.gif\" />"
				+ "</td><td align=\"center\" width=\"40%\" valign=\"top\"></td>"
				+ "</tr></tbody></table></td></tr><tr><td height=\"5\"><img height=\"12\" width=\"189\" src=\"../images/left_bg02.gif\" />"
				+ "</td></tr></tbody></table>";
	} else {
		loginMessage = "<form method=\"post\" action=\"userLogin.do\" >"
				+ "<table width=\"189\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"
				+ "<tr><td height=\"13\"><img src=\"../images/left_yh01.jpg\" alt=\"用户登入\" width=\"189\" height=\"25\" /></td>"
				+ "</tr><tr><td align=\"center\" valign=\"top\" background=\"../images/left_bg01.jpg\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
				+ "<tr><td width=\"40%\"><div align=\"right\"><img src=\"../images/kongxi_h16px.gif\" width=\"1\" height=\"10\" /></div></td>"
				+ "<td width=\"60%\" colspan=\"2\">&nbsp;</td></tr><tr><td height=\"25\" align=\"right\">用户名：</td>"
				+ "<td align=\"left\" colspan=\"2\"><input name=\"userID\" id=\"userID\" type=\"text\" size=\"10\" /></td>"
				+ "</tr><tr><td height=\"25\" align=\"right\">密　码：</td>"
				+ "<td align=\"left\" colspan=\"2\"><input name=\"password\" id=\"password\" type=\"password\" size=\"10\" /></td>"
				+ "</tr><tr><td height=\"25\" align=\"right\">方　式：</td><td align=\"left\" colspan=\"2\"><select name=\"type\" id=\"type\" size=\"1\">"
				+ "<option value=\"0\">买家</option><option value=\"1\">卖家</option> <option value=\"2\">管理员</option></select></td>"
				+ "</tr><tr><td height=\"8\" colspan=\"3\" align=\"right\" valign=\"middle\"><img src=\"../images/kongxi_h16px.gif\" width=\"1\" height=\"8\" /></td>"
				+ "</tr></table><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
				+ "<tr><td align=\"right\" valign=\"middle\"><a href=\"../account/regist.jsp\" class=\"TiShi\">卖家注册</a></td>"
				+ "<td align=\"center\" valign=\"middle\"><a href=\"account/getPwd.jsp\" class=\"TiShi\">忘记密码</a></td>"
				+ "<td align=\"center\" valign=\"top\"><input type=\"image\" src=\"../images/left_dr_an.jpg\" name=\"Submit\" /></td>"
				+ "</tr><tr><td width=\"33%\" height=\"10\" align=\"right\" valign=\"middle\"></td>"
				+ "<td width=\"33%\" align=\"center\" valign=\"middle\"><img src=\"../images/kongxi_h16px.gif\" width=\"1\" height=\"10\" /></td>"
				+ "<td width=\"34%\" align=\"center\" valign=\"top\"></td></tr>"
				+ "</table></td></tr><tr><td height=\"5\"><img src=\"../images/left_bg02.gif\" width=\"189\" height=\"12\" /></td>"
				+ "</tr></table></form>";
	}
	List<MenuItem> i = (List<MenuItem>) request
			.getAttribute("MenuItemList");
	if (i != null) {
		for (MenuItem m : i) {
			message2 += "<tr align=\"center\" class=\"SPJiFen STYLE4\">"
					+ "<td height=\"30\"></td>"
					+ "<td>"
					+ m.getMenuItemName()
					+ " </td>"
					+ "<td>"
					+ m.getMenuItemPrice()
					+ " ￥ </td>"
					+ "<td><img src=\"../images/"
					+ m.isAvailable()+".gif\">"
					+ "</td>"
					+ "<td><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"
					+ "<tbody><tr><td height=\"16\" width=\"3\"><img height=\"16\" width=\"3\" src=\"../images/actionbutton_left.gif\"/></td>"
					+ "<td background=\"../images/actionbutton_middle.gif\"><img height=\"1\" width=\"5\" src=\"/elearning/img/spacer.gif\"/></td>"
					+ "<td nowrap=\"\" valign=\"middle\" background=\"../images/actionbutton_middle.gif\">"
					+ "<a class=\"thickbox\" href=\"addOrder.jsp?menuID="
					+ m.getMenuItemID()
					+ "&height=270&width=300\">订购</a></td>"
					+ "<td background=\"../images/actionbutton_middle.gif\"><img height=\"1\" width=\"5\" src=\"/elearning/img/spacer.gif\"/></td>"
					+ "<td width=\"3\"><img height=\"16\" width=\"3\" src=\"../images/actionbutton_right.gif\"/></td>"
					+ "</tr></tbody></table></td><td></td></tr>";
		}
	}
%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<link rel="shortcut icon" href="/favicon.ico" />
		<link rel="Bookmark" href="/favicon.ico" />
		<title>51Dinner</title>
		<link href="../css/all.css" rel="stylesheet" type="text/css" />
		<link href="../css/thickbox.css" rel="stylesheet" type="text/css" />
		<script src="../js/main.js" type="text/javascript"></script>
		<script src="../js/net.js" type="text/javascript"></script>
		<script src="../js/jquery-1.2.6.js" type="text/javascript"></script>
		<script src="../js/thickbox.js" type="text/javascript"></script>
		<style type="text/css">
<!--
#toubiao {
	BORDER-BOTTOM: #ddd 1px solid;
	BORDER-top: #F0F0F0 1px solid;
	margin-bottom: 5px;
}

.STYLE4 {
	font-size: 10pt;
	font-weight: bold;
	color: #CC3300;
}
-->
</style>
	</head>
	<body>
		<center>
			<table width="766" border="0" align="center" cellpadding="0"
				cellspacing="0" bordercolor="#990033">
				<tr>
					<td>
						<img name="TOP_r5_c1" src="../images/TOP_r5_c1.jpg" width="25"
							height="58" border="0" id="TOP_r5_c1" alt="" />
					</td>
					<td background="../images/menu_xia_bg.jpg">
						<table width="100%" height="58" border="0" cellspacing="0"
							cellpadding="0">
							<tr>
								<td width="691">
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td colspan="2" height="3"></td>
										</tr>
										<tr>
											<td width="90%">
												<div align="center">&nbsp;
													<a class="MenuXia" href="../sellerPage.do">首页</a>&nbsp;|
													<a class="MenuXia" href="/help/help.jsp?sn=help_02"
														target="_blank">我的页面</a> |
													<a class="MenuXia" href="/help/help.jsp?sn=help_03"
														target="_blank">订餐搜索</a> |
													<a class="MenuXia"
														href="javascript:window.external.AddFavorite('http://www.51dinner.com','51Dinner网'); ">收藏本站</a>
												</div>
											</td>
											<td width="10%">
												&nbsp;
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<form name="top001"
										onsubmit="javascript:search();return false;">
										<table class="shousuo" width="100%" border="0" cellspacing="0"
											cellpadding="0">
											<tr>
												<td width="5%"></td>
												<td width="15%">
													<div align="left">
														搜索类型：
													</div>
												</td>
												<td width="30%">
													<select name="searchsel" id="searchsel">
														<option value="0">
															搜索所有商品
														</option>
														<option value="1">
															搜索所有卖家
														</option>
													</select>
												</td>
												<td width="25%">
													<input name="searchtext" id="searchtext" type="text"
														size="15" />
												</td>
												<td width="1%">
													&nbsp;
												</td>
												<td width="7%">
													<input class="SousAn" type="button" onclick="search();"
														value="搜 索" height="150" />
												</td>
												<td>
													&nbsp;
												</td>
											</tr>
										</table>
									</form>
								</td>
							</tr>
						</table>
					</td>
					<td align="right">
						<img src="../images/TOP_r5_c5.jpg" width="267" height="58" />
					</td>
				</tr>
			</table>
			<table width="600" align="center" border="0" cellspacing="4"
				cellpadding="0">
				<tr>
					<td align="left">
						你的位置：
						<a href="../sellerPage.do" class="MenuT">首页</a> >>
						<a href="menuTypePage.do?sellerID=<%=mt.getSellerID()%>"><%=mt.getSellerID()%></a> >> <%=mt.getDescription() %>
					</td>
				</tr>
			</table>
			<table width="766" cellspacing="0" cellpadding="0" border="0"
				align="center">
				<tr>
					<td align="left" valign="top">
						<%=loginMessage%>
						<table cellspacing="0" cellpadding="0" border="0" width="189">
							<tbody>
								<tr>
									<td height="13">
										<img height="25" width="189" src="../images/left_spfl.jpg" />
									</td>
								</tr>
								<tr>
									<td background="../images/left_bg01.jpg" align="center"
										valign="top">
										<table cellspacing="0" cellpadding="0" border="0" width="185">
											<tbody>
												<%=message1%>
											</tbody>
										</table>
									</td>
								</tr>
								<tr>
									<td height="5">
										<img height="12" width="189" src="../images/left_bg02.gif" />
									</td>
								</tr>
							</tbody>
						</table>
					</td>
					<td valign="top">
						<table width="563" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td align="center" valign="top">
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td height="25" align="left"
												background="../images/mid_bg_blue.gif">
												<marquee class="myColor"> 新版网站试运行,欢迎大家进行测评 </marquee>
											</td>
										</tr>
										<tr>
											<td height="10">
												<img src="../images/mid_bg_botad.gif" width="563"
													height="10" />
											</td>
										</tr>
									</table>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td height="24" valign="middle">
												<div align="center">
													<table width="99.6%" height="24" border="0" cellpadding="0"
														cellspacing="0" bgcolor="#e1f2ff"
														style="border: 1px solid #e0e0e0"
														background="../images/bg_blue_biaoti.gif">
														<tr>
															<td width="5%" align="center" valign="middle">
																<img src="../images/bttubiao.jpg" width="11" height="11" />
															</td>
															<td width="20%" align="left" valign="middle">
																<strong
																	style="font-size: 14px; color: #FF5500; letter-spacing: 1px"><%=mt.getDescription()%></strong>
															</td>

														</tr>
													</table>
												</div>
											</td>
										</tr>
										<tr>
											<td background="../images/mid_bg_line.gif" align="center"
												valign="top">
												<table valign="top" width="99%" border="0" cellspacing="0"
													cellpadding="0">
													<tr class="Caipu">
														<td height="30" width="30"
															background="../images/hy_jjdd.gif"></td>
														<td width="100" align="center"
															background="../images/hy_jjdd.gif">
															<strong>菜谱名</strong>
														</td>
														<td width="150" align="center"
															background="../images/hy_jjdd.gif">
															<b>菜谱价格</b>
														</td>
														<td width="100" align="center"
															background="../images/hy_jjdd.gif">
															<b>是否供货</b>
														</td>
														<td align="center" background="../images/hy_jjdd.gif">
															<b>可选操作</b>
														</td>
														<td width="30" background="../images/hy_jjdd.gif"></td>
													</tr>
						
													<%=message2%>
													<tr>
														<td colspan="6">
															<hr />
														</td>
													</tr>
													<tr>
														<td align="right" colspan="6">
															<%
																PageHelper p = (PageHelper)request.getAttribute("pageInfo");
																if(p == null)
																	p = new PageHelper();
																String pageShow = "";
																pageShow +="<a href=\""+p.getAdditionPath()+"pageNum=1\">首页</a> ";
																for(int i1=p.getCurrentPage()-4; i1<=p.getCurrentPage()+4; i1++){
																	if(i1>0 && i1<=p.getTotalPage()){
																		if( i1 != p.getCurrentPage() )
																			pageShow +="<a href=\""+p.getAdditionPath()+"pageNum="+i1+"\">"+i1+"</a> ";
																		else
																			pageShow +=p.getCurrentPage()+" ";
																	}
																}
																pageShow +="<a href=\""+p.getAdditionPath()+"pageNum="+p.getTotalPage()+"\">尾页</a> ";
															 %>
															 <%=pageShow %>
														</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td height="18">
												<img src="../images/mid_bg_bot.gif" width="563" height="18" />
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			<table cellpadding="0" cellspacing="0" align="center">
				<tr>
					<td>
						Copyright(C)2007-2008 51Dinner
					</td>
				</tr>
			</table>
	</body>
	</center>
</html>
